import { BaseCommand, TSelectRanage, TMergeCell } from '../types/common.interface';
import { TableDatas } from '../cors/table-datas';
import { RenderTrigger } from '../cors/render-trigger';
export class ColWidthCommand extends BaseCommand {
    protected pastSize: number;
    constructor(
        protected datas: TableDatas,
        protected renderTrigger: RenderTrigger,
        protected col: number, 
        protected width: number
    ) {
        super();
    }
    public execute() {
        let colInstance = this.datas.getWholeCol(this.col);
        this.pastSize = this.datas.getColWidth(this.col);
        colInstance.setWidth(this.width);
        this.datas.setWholeCol(colInstance, this.col);
        this.renderTrigger.triggerRenderAll();
        return true;
    }
    public redo() {
        let colInstance = this.datas.getWholeCol(this.col);
        colInstance.setWidth(this.pastSize);
        this.renderTrigger.triggerRenderAll();
        return true;
    }
}